package main

import (
	"encoding/json"
	"fmt"
	"log"
)

func main() {

	c := make(map[string]interface{})
	c["name"] = "huyanbing"
	c["contract"] = map[string]interface{}{
		"home":  "china",
		"phone": "12345678910",
	}

	//将这个映射序列化到json 字符串 ,//这里返回的data值，类型是[]byte
	data, err := json.MarshalIndent(c, "", "	")
	if err != nil {
		log.Println("Error:", err)
	}

	fmt.Println(string(data))
}
